package org.szgb.console.cxht.web;

import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.szgb.console.cxht.entity.CxhtLocationFormItem;
import org.szgb.console.cxht.mapper.CxhtLocationFormItemMapper;
import org.szgb.console.cxht.service.CxhtLocationFormItemService;
import org.szgb.core.base.web.BaseController;
import org.szgb.core.utils.AjaxJson;

@Slf4j
@RestController
@RequestMapping(value = "/cxht/location/form/item")
public class CxhtLocationFormItemController extends BaseController<CxhtLocationFormItemService, CxhtLocationFormItemMapper, CxhtLocationFormItem> {
    @Autowired
    public CxhtLocationFormItemController(CxhtLocationFormItemService cxhtLocationFormItemService) {
        super(cxhtLocationFormItemService);
    }


    @PostMapping("/findListByFormIdForForm")
    public AjaxJson findListByFormIdForForm(@RequestBody CxhtLocationFormItem entity, HttpServletRequest request, HttpServletResponse response) {
        // 返回成功的响应，并将实体对象放入响应中
        return AjaxJson.success(request, response).put("data", service.findListByFormIdForForm(entity.getId()));
    }
}
